{{Extend "layout"}}
{{Block "title"}}{{"表结构同步方案"|T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li class="active">{{"表结构同步方案"|T}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
	<div class="col-md-12">
		<div class="block-flat">
			<div class="header">
                <a href="__BACKEND__/db/schema_sync_add" class="btn btn-success pull-right">
                <i class="fa fa-plus"></i>
                {{"添加方案"|T}}
                </a>
				<h3>{{"表结构同步方案"|T}}</h3>
			</div>
			<div class="content">
				<div class="table-responsive">
				<table class="table no-border hover">
					<thead class="no-border">
						<tr>
							<th style="width:2%;"><strong>ID</strong></th>
							<th><strong>{{"数据库"|T}}</strong></th>
							<th><strong>{{"数据表"|T}}</strong></th>
							<th><strong>{{"可删"|T}}</strong></th>
							<th><strong>{{"创建/更新时间"|T}}</strong></th>
							<th style="width:130px" class="text-center"><strong>{{"操作"|T}}</strong></th>
						</tr>
					</thead>
					<tbody class="no-border-y">
                        {{range $k,$v := Stored.listData}}
						<tr>
							<td>{{$v.Id}}</td>
							<td>{{$v.DsnSource}}<br /><i class="fa fa-arrow-right"></i> {{$v.DsnDestination}}</td>
							<td>
                                {{if $v.Tables}}{{"同步"|T}}: {{$v.Tables}}{{else if not $v.SkipTables}}{{"全部"|T}}{{end}}
                                {{if $v.SkipTables}}<br />{{"跳过"|T}}: {{$v.SkipTables}}{{end}}
                            </td>
							<td>{{if gt $v.Drop 0}}{{"开启"|T}}{{else}}{{"关闭"|T}}{{end}}</td>
							<td>{{(Date $v.Created).Format "2006-01-02 15:04:05"}}<br />{{if gt $v.Updated 0}}{{(Date $v.Updated).Format "2006-01-02 15:04:05"}}{{else}}Non{{end}}</td>
							<td>
							<div style="margin-bottom:7px">
							<a class="label label-default" data-toggle="tooltip" href="__BACKEND__/db/schema_sync_add?copyId={{$v.Id}}" title="{{"复制"|T}}"><i class="fa fa-copy"></i></a>	
							<a data-toggle="tooltip" title="{{"加入计划任务"|T}}" class="label label-danger" href="__BACKEND__/task/add?command={{">mysql_schema_sync:"}}{{$v.Id}}"><i class="fa fa-clock-o"></i></a>
							<a data-toggle="tooltip" title="{{"预览"|T}}" class="label label-success" href="__BACKEND__/db/schema_sync_preview?id={{$v.Id}}"><i class="fa fa-eye"></i></a>
							<a data-toggle="tooltip" title="{{"同步"|T}}" class="label label-warning" href="__BACKEND__/db/schema_sync_run?id={{$v.Id}}" onclick="return confirm('{{"警告！本操作很危险！！！\n请确认您已经备份过目标数据库。\n确定要现在执行同步操作吗？"|T}}');"><i class="fa fa-refresh"></i></a></div>
							<div><a class="label label-primary" data-toggle="tooltip" title="{{"日志"|T}}" href="__BACKEND__/db/schema_sync_log/{{$v.Id}}"><i class="fa fa-comments-o"></i></a>
							<a data-toggle="tooltip" title="{{"修改"|T}}" class="label label-default" href="__BACKEND__/db/schema_sync_edit?id={{$v.Id}}"><i class="fa fa-pencil"></i></a>
							<a data-toggle="tooltip" title="{{"删除"|T}}" class="label label-danger" href="__BACKEND__/db/schema_sync_delete?id={{$v.Id}}" onclick="return confirm('{{"真的要删除吗？"|T}}');"><i class="fa fa-times"></i></a></div>
							</td>
						</tr>
                        {{end}}
					</tbody>
				</table>		
				</div>
				{{Stored.pagination.Render}}
			</div>
		</div>				
	</div>
</div>
{{/Block}}